<?php
$this->breadcrumbs=array(
	'Events'=>array('index'),
	$model->name,
);

$this->menu=array(
	array('label'=>'List All Events', 'url'=>array('index')),
	array('label'=>'Create An Event', 'url'=>array('create')),
	array('label'=>'Update ' . $model->name, 'url'=>array('update', 'id'=>$model->event_id)),
	array('label'=>'Delete ' . $model->name, 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->event_id),'confirm'=>'Are you sure you want to delete this event?')),
	array('label'=>'Manage Events', 'url'=>array('admin')),
	array('label'=>'Send QR Code to all Invited Guests', 'url'=>array('emailall', 'id'=>$model->event_id)),
);
?>

<h1><?php echo $model->name; ?></h1>

<?php
    foreach(Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
    }
?>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		//'event_id',
		'name',
		array (
			'type'=>'text',
			'label'=>'Number of Guests Invited',
			'value'=>$numGuestsInvited,
		),
	),
));
?>
<p></p>

<h1>Invited</h1>

<p>
<?php
echo CHtml::beginForm();
foreach ($guests as $guest) {
	$invited = false;
	foreach ($guestsInvited as $gi) {
		if ($guest->guest_id == $gi->guest_id) {
			$invited = true;
			break;
		}
	}
	echo CHtml::checkBox('guest[' . $guest->guest_id . ']', $invited);
	echo CHtml::label($guest->first_name . " " . $guest->last_name, 'guest[' . $guest->guest_id . ']');
	if ($invited) {
		echo " ";
		echo "(" . CHtml::link("View Barcode", array('barcode', 'id'=>$gi->id)) . ")";
	}
	echo "<br />";
}
echo CHtml::submitButton("Save");
echo CHtml::endForm();
?>
</p>
